<?php
echo 'Add product';
echo '<br /><br />';
echo $error;

echo form_open_multipart('addmincont/do_upload');
	echo "<table><tr>";
		echo "<td>";
			echo "Product Name : ";
		echo "</td>";
		echo "<td>";
			echo '<input type = "text" name = "namep" id = "namep" value="" size="30px"/>';
		echo "</td></tr>";
		
		echo "<tr><td>";
			echo "Product Code : ";
		echo "</td>";
		echo "<td>";
			echo '<input type = "text" name = "codep" id = "codep" value="" size="30px"/>';
		echo "</td></tr>";
		
		echo "<td>";
			echo "Product Description : ";
		echo "</td>";
		echo "<td>";
			echo '<textarea rows="4" cols="26" name = "descriptionp" id = "descriptionp" value=""></textarea> ';
		echo "</td></tr>";
		
		echo "<tr><td>";
			echo "Product Demension : ";
		echo "</td>";
		echo "<td>";
			echo '<textarea rows="4" cols="26" name = "demensionp" id = "demensionp" value=""></textarea> ';
		echo "</td></tr>";
		
		echo "<td>";
			echo "Product Assembly : ";
		echo "</td>";
		echo "<td>";
			echo '<input type = "text" name = "assemblyp" id = "assemblyp" value="" size="30px"/>';
		echo "</td></tr>";
		
		echo "<tr><td>";
			echo "Product Material : ";
		echo "</td>";
		echo "<td>";
			echo '<input type = "text" name = "materialp" id = "materialp" value="" size="30px"/>';
		echo "</td></tr>";
		
		echo "<tr><td>";
			echo "Product Color : ";
		echo "</td>";
		echo "<td>";
			echo '<input type = "text" name = "colorp" id = "colorp" value="" size="30px"/>';
		echo "</td></tr>";
		
		echo "<tr><td>";
			echo "Product Price : ";
		echo "</td>";
		echo "<td>";
			echo '<input type = "text" name = "pricep" id = "pricep" value="" size="30px"/>';
		echo "</td></tr>";
		
		echo "<tr><td>";
			echo "Product Type : ";
		echo "</td>";
		echo "<td>";
			echo '<select name = "typep" id = "typep" />';
			echo '<option value="">Categories Type</option>';
			$couttype = count($catetype);
			for($i=0;$i<$couttype;$i++){
				$type = $catetype[$i]['cat_type_name'];
				echo '<optgroup label="'.$type.'">';
				$order = array(' ','/','_','&','%','@',';','"',"'",'{','}');
	  			$type = str_replace($order, "", $type); 
				$couttypesub = count($catetype[$i][0]);
				for($j=0;$j<$couttypesub;$j++){
					echo '<option value="'.$catetype[$i][0][$j]['cat_type_sub_id'].'_'.$type.'">'.$catetype[$i][0][$j]['cat_type_sub_name'].'</option>';
				}
			}
		echo "</td></tr>";
		
		echo "<tr><td>";
			echo "Product Sort : ";
		echo "</td>";
		echo "<td>";
			echo '<input type = "text" name = "sortp" id = "sortp" value="" size="30px"/>';
		echo "</td></tr>";
		
		echo "<tr><td>";
			echo "Product Size : ";
		echo "</td>";
		echo "<td>";
			echo '<input type = "text" name = "sizep" id = "sizep" value="" size="30px"/>';
		echo "</td></tr>";
		
		echo "<tr><td>";
			echo "Product Images : ";
		echo "</td>";
		echo "<td>";
			echo '<input type="file" name="userfile" id = "userfile" size="30px" />';
		echo "</td></tr>";
		
		echo "<tr><td colspan='2'>";
			
			echo '<input type="submit" value="Add" />';
		echo "</td>";
echo '</tr></table></form>';